import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "@/views/Index";
import Detail from "@/views/Detail";
import HotNews from "@/views/HotNews";
import Mine from "@/views/Mine";
import Video from "@/views/Video";
import VideoDetail from "@/views/VideoDetail";
import Collect from "@/views/Collect";
import Subscription from "@/views/Subscription";
import Personal from "@/views/Personal";
import Home from "@/Layout/Home";
import Epidemic from "@/components/Epidemic";
import Personupdate from "@/views/Personupdate";
import Search from "@/views/Search";
import Play from "@/views/Play";
import Constellation from "@/components/Constellation";
import Wallpaper from "@/components/Wallpaper";
import Puzzle from "@/views/Puzzle";

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home/index'
  },
  { //首页
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      { //首页
        path: 'index',
        name: 'Index',
        component: Index
      },
      { //热门新闻
        path: 'hotNews',
        name: 'HotNews',
        component: HotNews
      },
      { //我的
        path: 'mine',
        name: 'Mine',
        component: Mine
      },
      { //视频列表
        path: 'video',
        name: 'Video',
        component: Video
      },
    ]
  },
  {
    path: '/detail',
    name: 'Detail',
    component: Detail
  },
  {//视频详情
    path: '/videoDetail',
    name: 'VideoDetail',
    component: VideoDetail
  },
  { //我的收藏
    path: '/collect',
    name: 'Collect',
    component: Collect
  },
  { //我的订阅
    path: '/subscription',
    name: 'Subscription',
    component: Subscription
  },
  { //个人资料
    path: '/personal',
    name: 'Personal',
    component: Personal
  },
  { //个人资料
    path: '/personupdate',
    name: 'Personupdate',
    component: Personupdate
  },
  {// 疫情页
    path: '/epidemic',
    name: 'epidemic',
    component: Epidemic
  },
  {// 随机壁纸
    path: '/wallpaper',
    name: 'Wallpaper',
    component: Wallpaper
  },
    //随心听歌曲搜索页
  {
    path: '/search',
    name: 'Search',
    component: Search
  },
    //播放页
  {
    path: '/play',
    name: 'Play',
    component: Play
  },
  {// 星座
    path: '/constellation',
    name: 'Constellation',
    component: Constellation
  },
  {// 拼图
    path: '/puzzle',
    name: 'Puzzle',
    component: Puzzle
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
